<div id="main2" style="width: 1200px;height: 500px"></div>
<script>
    var chartDom = document.getElementById('main2');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        //title: {
        //  text: 'Step Line'
        //},
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            selectedMode: 'single',
            data: ['在库数量趋势', '价格趋势','在库价值趋势']
        },
        dataZoom: [
            {
                type: 'inside'
            },
            {
                type: 'slider'
            }
        ],
        grid: {
            left: '5%',
            right: '5%',
            bottom: 70,
            {#containLabel: true#}
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'time',
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name: '在库数量趋势',
                type: 'line',
                step: 'end',
                data: {{ sql_num|tojson }}
            },
            {
                name: '价格趋势',
                type: 'line',
                step: 'end',
                data: {{ sql_price|tojson }}
            },
            {
                name: '在库价值趋势',
                type: 'line',
                step: 'end',
                data: {{ cmy|tojson }}
            }
        ]
    };

    option && myChart.setOption(option);
</script>